package com.longshihan.testdagger;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import javax.inject.Inject;

import okhttp3.OkHttpClient;

public class MainActivity extends AppCompatActivity {
    //    private UserManager mUserManager;

    //意思是我们需要这个实例
    //@Named("release")
    //@Test
    @Inject
    APiService mAPiService_release;

    // @Named("dev")
   /* @Inject
    APiService mAPiService_dev;*/

    @Inject
    UserManager mUserManager;


    @Inject
    OkHttpClient okhttp1;

    @Inject
    OkHttpClient okhttp2;

    private boolean is_dev = true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //mUserManager = new UserManager(this);
        //mUserManager.register();

        //        DaggerUserComponet.create().inject(this);
        //mAPiService.register();

        DaggerUserComponet.builder().userModele(new UserModele(this))
                .appComponent(((MyApplication) getApplication()).getAppComponent())
                .build().inject(this);
        // mUserManager.register();

       /* if (is_dev) {
            mAPiService_dev.register();
        } else {
            mAPiService_release.register();
        }*/
    }
}
